package com.albaba.designpattern.observer.text_003;

import com.albaba.designpattern.observer.text_002.DrawHouseService;
import com.albaba.designpattern.observer.text_002.LotteryResult;

import java.util.Date;

/**
 * @Description: TODO
 * @Author zx
 * @Date 2025/2/24 15:44
 * @Version 1.0
 */
public class LotteryServiceImpl extends LotteryService {

    // 注入摇号服务
    private DrawHouseService houseService = new DrawHouseService();

    @Override
    public LotteryResult lottery(String uId) {
        // 摇号
        String lots = houseService.lots(uId);

        return new LotteryResult(uId, lots,new Date());
    }
}
